/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package healthcare.coursework.util;

import java.sql.Timestamp;
import java.util.Calendar;
import java.util.Date;
import java.util.List;

/**
 *
 * @author Administrator
 */
public class Utility {

    /**
     * Connect all element in the list to String by the comma
     * @param lst
     * @return
     */
    public static String parseListToString(List lst) {
        String lstOfValues = "";
        for (int i = 0; i < lst.size(); i++) {
            String str = lst.get(i) + "";
            if (i == (lst.size() - 1)) {
                lstOfValues += "" + str + "";
            } else {
                lstOfValues += "" + str + ",";
            }
        }
        return lstOfValues;
    }

    /**
     * Convert value of Date datatype to Timestamp datatype
     * @param dateOfBirth
     * @return
     */
    public static Timestamp convertDateToTimestamp(Date date) {
        Timestamp ts = new Timestamp(date.getTime());

        return ts;
    }

   


}
